﻿namespace Himp.TaskScheduling.Hangfire.Models
{
    public class EventMsgRec
    {
        public Guid Id { get; set; }

        /// <summary>
        /// 全路径
        /// </summary>
        public string TopicFullPath { get; set; }

        /// <summary>
        /// 消息类型
        /// </summary>
        public string MsgTopicName { get; set; }

        /// <summary>
        /// 消息内容
        /// </summary>
        public string MsgCont { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public int EventMsgOperStas { get; set; }

        public DateTime CreationTime { get; set; }

        public string ExtraProperties { get; protected set; }

        public string ConcurrencyStamp { get; set; }

        public EventMsgRec(string topicFullPath, string msgTopicName, string msgCont)
        {
            Id= Guid.NewGuid();
            TopicFullPath = topicFullPath;
            MsgTopicName = msgTopicName;
            MsgCont = msgCont;
            EventMsgOperStas = 0;
            CreationTime = DateTime.Now;
            ConcurrencyStamp = Guid.NewGuid().ToString("N");
            ExtraProperties = string.Empty;
        }

        public EventMsgRec(string topicFullPath, string msgTopicName, string msgCont, DateTime creationTime)
        {
            Id = Guid.NewGuid();
            TopicFullPath = topicFullPath;
            MsgTopicName = msgTopicName;
            MsgCont = msgCont;
            EventMsgOperStas = 0;
            CreationTime = creationTime;
            ConcurrencyStamp = Guid.NewGuid().ToString("N");
            ExtraProperties = string.Empty;
        }
    }
}
